<?php
include_once( "inc/config.php" );
include_once( "inc/config_db.php" );
include_once( "inc/linb.php" );
include_once( "inc/template.php" );
include_once "inc/class.page.php";
$location = location( "notice","" );
define( "IN", TRUE );
$_classArray = array(
	3 => '其它公告',
	1 => '招投标信息',
	2 => '废旧物资处理信息'
);
function getClass($keys){
	global $_classArray;
	foreach ($_classArray as $key => $value){
		if ($keys == $key) {
			return $value;
		}
	}
	return false;
}
$tpl_refresh_time = $skincache;
$tpl_default_dir = dirname( __FILE__ )."/templates/".$skindir."";
$t = new template( );
$t->tpl_default_dir = $tpl_default_dir;
$t->tpl_refresh_time = $tpl_refresh_time;
$noticeid = verify_id( $_GET['id'] );
if (!empty($noticeid)) { //显示公告内容
	$strSql = "SELECT * FROM tun2_notice WHERE id =$noticeid";
	$db->query( $strSql );
	if ( $db->next_record( ) )
	{
		$title = $db->Record['title'];
		$content = $db->Record['content'];
		$class = getClass($db->Record['class']);
		$date = $db->Record['time'];
	}else{
		echo "<script language=javascript>alert(\"对不起！没有您要找的公告！\");window.location='".$webdir."index.php'</script>";
		exit( );
	}
	$temp = 'view_notice';
}elseif (verify_id($_GET['bid'])==3){
	$temp = 'notice_qt';
}elseif (verify_id($_GET['bid'])==1){//招投票信息
	$temp = 'notice_zb';
}elseif (verify_id($_GET['bid'])==2){
	$temp = 'notice_fj';
} else { //显示公告列表
	$temp = 'notice';
}

//$formovie = "onclick=\"openFormovie()\"";
$page=verify_id(@$_GET['PB_page']);
$classid=verify_id($_GET['id']);
include($t->tpl($temp));
//echo "<script type=\"text/javascript\" src=\"".$webdir."inc/ajaxrequest.js\"></script>\n";
//echo formovie();
?>
